import { ref, reactive, computed } from "vue"
import { addGroup,getLatestGroup, getGroup, updateGroup,addMessage,getMessage,updateMessage } from "../../utils/db"
import { getCurrentGroupId, setCurrentGroupId, getHistoryMessages } from "../../utils/ops"
import clipboard from "clipboard"

export default (props) => {
    const {} = props;
    //



    // 复制 e:Event t:content text
    const copy = (e,t) => {
        const cb =  new clipboard('.btn',{text:() => t})
        return new Promise((r) => {
            cb.on('success',() => r(true))
            cb.on('error',() => r(false))
            cb.onClick(e)
        })
    }

    //  初始化 Group
    const initGroup = async () => {
        let md = await getLatestGroup();
        if(!md){
            
        }
    }




    return {
        copy
    }
}